package com.cn.demo.springboot.globalexception.service;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.springframework.http.HttpStatus;

public class DefaultViewNameInterfacesImpl implements ViewNameInterfaces {
	
	@Override
	public String getViewName(Exception ex, HttpStatus status, Object handler) {
		if(!SecurityUtils.getSubject().isAuthenticated() && ex instanceof AuthenticationException){
			return "loginpage";
		}
		return "error500";
	}

}
